package client.view;

import core.Card;

public class SelectionRegistry 
{
	public static java.util.List<Card> getSelectedCards() {
		return java.util.Collections.unmodifiableList(selected);
	}

	public static void add(Card c) {
		if (c == null) return;
		if (selected.contains(c)) return;
		selected.add(c);
	}

	public static void remove(Card c) {
		selected.remove(c);
	}

	public static void clear() {
		selected.clear();
	}

	public static void toggle(Card c) {
		if (contains(c)) 
			remove(c);
		else
			add(c);
	}

	public static boolean contains(Card c) {
		return selected.contains(c);
	}

	private static final java.util.List<Card> selected = new java.util.LinkedList<Card>();
}
